#ifndef FUNCEHW_H
#define FUNCEHW_H
#include "cdecl.h"
#include "trajectory.h"
#include "current.h"
#include "func_trapz.h"

/**
 * This module provides functions to calculate electromagnetic field 
 * spectral components.
 */


/**
 * Calculates electromagnetic field component spectrum.
 * @param field_class - calculate E or H
 * @param r - observation point
 * @param eps - calculation precision
 * @param n - field projection to return, field projection to this vector 
 * (after vec. normalisation) will be returned.
 * @param w - 2*pi*frequency to calculate spectrum for
 * @param trj - trajectory object
 * @param trlen - trajectory length structure to calculate t -> l function
 * @param crnt - current object
 * @param result - valiable to push result to
 * @return 0 - OK
 *         > 0 - integrator failed, value is func_trapz error code(see func_trapz.h)
 */
int func_EHw_calc(enum field_EH field_class, double eps, const double * r, const double * n,
	double w, const union trajectory * trj, const union trajectory_len * trlen, 
	const struct current * crnt, complex * result);



#endif
